package Jun13.index;

import Jun13.utils.ESUtils;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.GetIndexRequest;
import org.elasticsearch.client.indices.GetIndexResponse;

import java.io.IOException;

public class GetIndex {

    public static void main(String[] args) throws IOException {
        RestHighLevelClient rest = ESUtils.getRest();//获取ES操作对象
        GetIndexRequest index = new GetIndexRequest("user");//获取索引
        GetIndexResponse get = rest.indices().get(index, RequestOptions.DEFAULT);//发送获取信息的请求
        System.out.println(get.getSettings());//打印获取信息
        rest.close();//关闭资源
    }
}
